using Microsoft.Phone.Controls;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace MicroMsg.UI.UserContrl
{
	public class TileButton : UserControl
	{
		public delegate void ListItemClick(object sender, RoutedEventArgs e);
		private bool bIsMoved;
		internal Grid btnRoot;
		internal TextBlock txtTitle;
		private bool _contentLoaded;
		public event TileButton.ListItemClick btnClick;
		public TileButton()
		{
			this.InitializeComponent();
			base.add_MouseLeftButtonDown(new MouseButtonEventHandler(this.btnRoot_MouseLeftButtonDown));
			base.add_MouseLeftButtonUp(new MouseButtonEventHandler(this.btnRoot_MouseLeftButtonUp));
			base.add_MouseMove(new MouseEventHandler(this.btnRoot_MouseMove));
			base.SetValue(TiltEffect.IsTiltEnabledProperty, true);
		}
		private void btnRoot_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
		{
			this.bIsMoved = false;
		}
		private void btnRoot_MouseMove(object sender, MouseEventArgs e)
		{
			this.bIsMoved = true;
		}
		private void btnRoot_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
		{
			if (!this.bIsMoved && this.btnClick != null)
			{
				this.btnClick(this, null);
			}
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/UI/CommonUseControl/TileButton.xaml", 2));
			this.btnRoot = (Grid)base.FindName("btnRoot");
			this.txtTitle = (TextBlock)base.FindName("txtTitle");
		}
	}
}
